package ch.mzimmermann.sjes;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * <div>Annotation used for Event Receivers</div>
 * <h2>Sample</h2>
 * <div>
 * <code>
 * <pre>
 * &#64;EventReceiver(handleFor={"calculator1", "calculator2"}, exact=true)
public void onResult(Calculator.Event e) {
System.out.println("Calculator got: " + e.result);
}
 * </pre>
 * </code>
 * </div>
 *
 * @author Martin Zimmermann
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface EventReceiver {

    /**
     * Handle events only for specified objects in list
     * @return
     */
    String[] handleFor() default "";

    /**
     * Handle events only if the event class matches exact (no inheritance)
     * @return
     */
    boolean exact() default false;
}
